import http from "@/api/config/http";
import { IQuery } from "@/interface/IAxios";

// 查询菜单列表
export function listMenu(query: IQuery) {
  return http.request({
    url: "/system/menu/list",
    method: "get",
    params: query
  });
}
// 删除菜单
export function delMenu(menuId: string[]) {
  return http.request({
    url: `/system/menu/${menuId}`,
    method: "delete"
  });
}
// 根据角色ID查询菜单下拉树结构
export function roleMenuTreeselect(roleId: string) {
  return http.request({
    url: `/system/menu/roleMenuTreeselect/${roleId}`,
    method: "get"
  });
}
// 修改菜单
export function updateMenu(data: any) {
  return http.request({
    url: "/system/menu",
    method: "put",
    data
  });
} // 新增菜单
export function addMenu(data: any) {
  return http.request({
    url: "/system/menu",
    method: "post",
    data
  });
}
